/**
 * \file wtftypes.h
 * WTF Type Definitions and Helper Macros.
 *
 * Provides:
 * 	- definitions of common types in the WTF Engine
 *  - semantic synonyms
 *  - macros for manipulating bitfields/flagfield
 * 		- note: each flag is referred to as 'flag'
 */


#ifndef __wtftypesH__
#define __wtftypesH__

typedef float			tScalar;

typedef tScalar			tRadians;
typedef tScalar			tDegrees;

typedef char *			tString;
typedef const char *	tConstString;

// Semantic labels
#define tDirection		tVector
#define tPosition		tVector


/**** Implementation Interfaces *****/

#define IMPL(Cls) _I ## Cls
#define IMPLEMENTS(Cls)	public IMPL(Cls)

#define IMPL_INTERFACE(Cls) \
	class _I ## Cls

#define IMPL_DECL_NOSTUB(Decl)	\
	private: Decl { };

#define IMPL_DECL(Decl)	\
	public: Decl { throw new logic_error("Interface function - not implemented"); };


/**** Bitfield (or flagfield or whatever) macros ****/

/// Check whether at least 1 flag(s) is in a flag field
#define CHECKFLAG(flag,flags)		(flags & flag)
/// Checks wheter a group of flags are all in field
#define CHECKFLAGS(flag, flags) 	((flags & flag) == flag)
/// Sets flag(s) in a list
#define SETFLAGS(flag, flags) 		flags = flags | flag
/// Unsets flag(s) in a list
#define UNSETFLAGS(flag, flags)		flags = flags & ~(flag)
/// toggles the state of a flag
#define TOGGLEFLAGS(flag, flags)		flags = flags ^ (flag)


#endif
